package com.sm.service;

import java.util.List;

import com.sm.model.UserAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sm.dao.UserAddressMapper;

@Service
public class UserAddressService {

    @Autowired
    private UserAddressMapper userAddressMapper;

    public List<UserAddress> selectByUserId(Integer userAddressId) {
        return userAddressMapper.selectByUserId(userAddressId);
    }

    public int insertSelective(UserAddress record) {
        return userAddressMapper.insertSelective(record);
    }

    public int updateByPrimaryKeySelective(UserAddress record) {
        return userAddressMapper.updateByPrimaryKeySelective(record);
    }

    public UserAddress selectByPrimaryKey(Integer userAddressId) {
        return userAddressMapper.selectByPrimaryKey(userAddressId);
    }

    public UserAddress selectByUidAndIsdefault(Integer userId) {
        return userAddressMapper.selectByUidAndIsdefault(userId);
    }

    public void deleteAddress( Integer[] userAddressIds) {
        userAddressMapper.deleteAddress(userAddressIds);

    }
}
